//
//  DeleteView.m
//  QRMaster
//
//  一个删除的公共view 前面图片 后面文字
//  Created by myApple on 16/4/27.
//  Copyright © 2016年 myApple. All rights reserved.
//

#import "DeleteView.h"

@interface DeleteView()
{
    UIImageView * titleImageView;
    UILabel * titleLabel;
}

@end

@implementation DeleteView

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
        [self prepareView];
    }
    return self;
}

-(void)prepareView
{
    float x = 22;
    float y = (self.frame.size.height - 16)/2.0;
    float width = 14;
    float height = 16;
    
    titleImageView = [[UIImageView alloc]initWithFrame:CGRectMake(x, y, width, height)];
    [self addSubview:titleImageView];
    
    x += width + 10;
    width = self.frame.size.width - x;
    y = (self.frame.size.height - 20)/2.0;
    height = 20;
    titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(x, y, width, height)];
    titleLabel.font = [UIFont systemFontOfSize:16.0];
    titleLabel.textColor = UIColorFromRGB(0xffffff);
    [self addSubview:titleLabel];
    
}

-(void)setImageString:(NSString *)imageString
{
    _imageString = imageString;
    titleImageView.image = [UIImage imageNamed:imageString];
}

-(void)setTitleString:(NSString *)titleString
{
    _titleString = titleString;
    titleLabel.text = titleString;
}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
